fix(datetime): tighten gen and whitelist#7
Merged
2010YOUY01 merged 1 commit intoApr 19, 2026
Merged
Conversation
2010YOUY01
approved these changes
Apr 19, 2026
| use super::is_error_whitelisted; | ||
|
|
||
| #[test] | ||
| fn whitelists_timestamp_parse_errors_for_to_timestamp_queries() { |
Collaborator
There was a problem hiding this comment.
Follow-up idea: I think an alternative testing strategy is: running this query on datafusion, and assert the expected error is returned.
Once DF is updated with different error messages, we can catch them from UTs and directly update the whitelist, which can be easier to investigate comparing to the fuzzer oracle inconsistencies.
| TypeGroup::OneOf(vec![FuzzerDataType::String.to_datafusion_type()]), | ||
| ]], | ||
| ])], | ||
| vec![ |
Collaborator
There was a problem hiding this comment.
It's a good idea to try to generate valid signature at this level.
If we want to inject more randomness to generate invalid exprs, we can do that at the expr-generation layer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two datetime-related fuzzer issues.
First, it tightens
to_unixtimegeneration so format arguments are only generated for string input, which matches the function contract.Second, it expands the whitelist for expected datetime parse failures from generated format strings.
Why
The fuzzer was still producing avoidable
NoCrashnoise from datetime functions.Examples:
to_unixtime(timestamp, format)even though extra format arguments only work with string inputto_date/to_timestamp/to_unixtimeformat strings as non-whitelisted errorsThese are generator or whitelist issues, not real engine crashes.
What changed
to_unixtimeargument generation